import request from '@/utils/request'

// 获取用户资料
export function getUserProfile() {
  return request({
    url: '/system/user/profile',
    method: 'GET'
  })
}

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword
  }
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'PUT',
    params: data,
  })
}

// 查询协议管理列表
export function listAgreement(query) {
  return request({
    url: '/property/agreement/list',
    method: 'GET',
    params: query
  })
}

export function getAgreement(id) {
  return request({
    url: '/property/agreement/' + id,
    method: 'GET'
  })
}
// 查询巡检记录列表
export function listRecord(query) {
  return request({
    url: '/property/record/list',
    method: 'GET',
    params: query
  })
}

// 获取巡检任务列表
export function listPlan(query) {
  return request({
    url: '/property/scheme/plan/list',
    method: 'GET',
    params: query
  })
}

// 新增巡检记录
export function addRecord(data) {
  return request({
    url: '/property/record',
    method: 'POST',
    data: data
  })
}
